package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.TenantPsychologicalCounselingMapper;
import com.hgkj.cloud.base.domain.TenantPsychologicalCounseling;
import com.hgkj.cloud.base.service.TenantPsychologicalCounselingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TenantPsychologicalCounselingServiceImpl implements TenantPsychologicalCounselingService {

    @Autowired
    private TenantPsychologicalCounselingMapper tenantPsychologicalCounselingMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return tenantPsychologicalCounselingMapper.delPsychologicalCounseling(id);
    }

    @Override
    public int insert(TenantPsychologicalCounseling record) {
        return tenantPsychologicalCounselingMapper.insert(record);
    }

    @Override
    public int insertSelective(TenantPsychologicalCounseling record) {
        return tenantPsychologicalCounselingMapper.insertSelective(record);
    }

    @Override
    public TenantPsychologicalCounseling selectByPrimaryKey(Long id) {
        return tenantPsychologicalCounselingMapper.selectByPrimaryKey(id);
    }

    @Override
    public TenantPsychologicalCounseling getLastPsychologicalCounseling(Long id) {
        return tenantPsychologicalCounselingMapper.getLastPsychologicalCounseling(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TenantPsychologicalCounseling record) {
        return tenantPsychologicalCounselingMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TenantPsychologicalCounseling record) {
        return tenantPsychologicalCounselingMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<TenantPsychologicalCounseling> listPsychologicalCounselingByMap(Map<String, Object> map) {
        return tenantPsychologicalCounselingMapper.listPsychologicalCounselingByMap(map);
    }

    @Override
    public long listPsychologicalCounselingCount(Map<String, Object> map) {
        return tenantPsychologicalCounselingMapper.listPsychologicalCounselingCount(map);
    }

    @Override
    public int delPsychologicalCounseling(Long id) {
        return tenantPsychologicalCounselingMapper.delPsychologicalCounseling(id);
    }

    @Override
    public List<Map<String, Object>> getPsychologicalCounselingStatistics(Map<String, Object> map) {
        return tenantPsychologicalCounselingMapper.getPsychologicalCounselingStatistics(map);
    }

    @Override
    public List<Map<String, Object>> statMonthConsulting(Map<String, Object> map) {
        return tenantPsychologicalCounselingMapper.statMonthConsulting(map);
    }

    @Override
    public Map<String, Object> statConsultingManner(Map<String, Object> map) {
        return tenantPsychologicalCounselingMapper.statMonthConsultingManner(map);
    }

    @Override
    public Map<String, Object> statPsyCounselingGender(Map<String, Object> map) {
        return tenantPsychologicalCounselingMapper.statPsyCounselingGender(map);
    }

    @Override
    public List<Map<String, Object>> getUserPsyCounseling(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantPsychologicalCounselingMapper.getUserPsyCounseling(map);
    }

    @Override
    public Long getUserPsyCounselingCount(Map<String, Object> map) {
        return tenantPsychologicalCounselingMapper.getUserPsyCounselingCount(map);
    }
}
